package com.syy.statisticalresults;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class GradeComparator2 extends WritableComparator {
    protected GradeComparator2(){
        super(Grade.class, true);
    }
    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        Grade g1 = (Grade) a;
        Grade g2 = (Grade) b;
        return g2.getAvg().compareTo(g1.getAvg());
    }
}
